<template>
<div>
  <el-row  style="margin-bottom:60px;margin-top: 10px">
    <el-col :span="6">
      <el-card style="color: #409EFF">
        <div ><i class="el-icon-user-solid"></i>员工人数</div>
        <div style="padding: 10px 0;text-align: center;font-weight: bold">
          <el-tag type="primary" style="font-size: 15px">100</el-tag>
        </div>
      </el-card>
    </el-col>
    <el-col :span="6">
      <el-card  style="color: #67C23A">
        <div><i class="el-icon-money"></i>销售总量</div>
        <div style="padding: 10px 0;text-align: center;font-weight: bold">
          ￥ 100000
        </div>
      </el-card>
    </el-col>
    <el-col :span="6">
      <el-card style="color: #E6A23C">
        <div><i class="el-icon-bank-card"></i>收益总额</div>
        <div style="padding: 10px 0;text-align: center;font-weight: bold">
          ￥ 300000
        </div>
      </el-card>
    </el-col>
    <el-col :span="6">
      <el-card style="color: #F56C6C">
        <div><i class="el-icon-s-shop"></i>门店总数</div>
        <div style="padding: 10px 0;text-align: center;font-weight: bold">
          100
        </div>
      </el-card>
    </el-col>
  </el-row>
  <el-row>
    <el-col :span="12">
      <div id="main" style="width: 500px;height: 450px; "></div>
    </el-col>
    <el-col :span="12">
      <div id="pie" style="width: 500px;height: 420px; "></div>
    </el-col>
  </el-row>

</div>
</template>

<script>

import * as echarts from 'echarts';

export default {
  name: "Data.vue",
  data(){
      return{

      }
  },
  mounted() {   //页面元素渲染后展示
    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option = {
      title: {
        text: '各季度销售数量统计',
        subtext:'趋势图',
        left: 'center'
      },
      xAxis: {
        type: 'category',
        data: ["第一季度","第二季度","第三季度","第四季度"]
      },
      yAxis: {
        type: 'value'
      },
      legend: {
        orient: 'vertical',
        left: 'left'
      },
      series: [
        {
          name:"李宁",
          data: [1200, 1700, 2880, 2300],
          type: 'line'
        },
        {
          name:"安踏",
          data: [1500, 2300, 2240, 2180],
          type: 'bar'
        }, {
          name:"李宁",
          data: [1200, 1700, 2880, 2300],
          type: 'bar'
        }
      ]
    };
    myChart.setOption(option);

    //饼图
    var pieoption = {
      title: {
        text: '商品销量统计',
        subtext: '比例图',
        left: 'center'
      },
      tooltip: {
        trigger: 'item'
      },
      legend: {
        orient: 'vertical',
        left: 'left'
      },
      series: [
        {
          name: '商品',
          type: 'pie',
          radius: '50%',
          data: [
            { value: 1048, name: '服饰' },
            { value: 735, name: '电子产品' },
            { value: 580, name: '零食' },
            { value: 484, name: '体育用品' },
            { value: 300, name: '生活用品' }
          ],
          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: 'rgba(0, 0, 0, 0.5)'
            }
          }
        }
      ]
    };
    var pieDom = document.getElementById('pie');
    var pieChart = echarts.init(pieDom);
    pieChart.setOption(pieoption);

  }
}
</script>

<style scoped>

</style>